######################Simulations for posterior predictive p-values#############
###################################Test function################################
###################strong null + unstudentized test statistics##################
#####################params$M, m are set to very small values###################
#######This file can be used to test whether the codes functioning well#########


###############################load packages####################################
# if(!require(MCMCpack)) install.packages(MCMCpack)
# if(!require(parallel)) install.packages(parallel)
# if(!require(tidyverse)) install.packages(tidyverse)
# if(!require(Matching)) install.packages(Matching)
# if(!require(latex2exp)) install.packages(latex2exp)
library(MCMCpack)
library(parallel)
library(tidyverse)
library(Matching)
library(latex2exp)


#######You can set the nNodes according to the number of cores of the CPU#######
#nNodes <- detectCores() - 2
nNodes <- 4
M <- 3


################################ load functions ################################
#####Put the 5 files into a same folder and set it as the working directory#####
#setwd("~/PPPPP")
source("Main Function.R",local = T)
source("estimating.R",local = TRUE)
source("testing.R",local = TRUE)
source("dta_generating.R",local = TRUE)
source("data processing.R",local = T)


#################################set the parameter##############################
params$m <- 10
params$M <- 3
params$data <- 'regular'
params$is.indiv <- T
params$normalize <- F


ppp <- para.cal(simu.test,10,NA,seed)
dta_plot(ppp)
#save.image("ppp weak null unstu.RData")

